package com.xcity.db.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.xcity.db.entity.Guild;

import naga.x.db.IMapper;

public interface GuildMapper extends IMapper<Guild> {
	String STATEMENT_DELETE_GUILD_BY_GUILD = GuildMapper.class.getName() + ".deleteById";
	String STATEMENT_COUNT_GUILD_BY_NAME = GuildMapper.class.getName() + ".getGuildCountByGuildName";
	String STATEMENT_FIND_GUILD_BY_NAME = GuildMapper.class.getName() + ".findGuildsByName";	


	/**
	 * 根据名字查找公会数量 判断重名公会
	 * @param name
	 * @return
	 */
	int getGuildCountByGuildName(String name);
	/**
	 * 根据名字查找公会 (公会列表界面用)
	 * @param name
	 * @return
	 */
	List<Guild> findGuildsByName(@Param("name")String name, @Param("limit")int limit);
	
	/**
	 * 根据公会ID删除(解散公会)
	 * @param id
	 * @return
	 */
	int deleteById(int id);
}
